#ifndef _cesium_timer_hpp_
#define _cesium_timer_hpp_

#include "time.hpp"
#include <boost/function.hpp>

namespace Cesium {

/** Timer concept.  Used to provide callbacks after a period of time. */
class Timer {
public:
    typedef uint64 DurationType; // typedef your own duration type
    typedef uint64 TimeTime; // typedef your own time type

    typedef boost::function0<void> TimerCallback; // callback must match this typedef

    /** Must be copyable, should be cheap. */
    Timer(const Timer& cpy);

    /** Registers a timer to signal after the given duration. */
    void timer(const DurationType& duration, TimerCallback cb);

    /** Registers a timer to signal at the given time. */
    void timer(const TimeType& time, TimerCallback cb);

    /** Gets the current time. */
    TimeType current();
}; // class Timer

} // namespace Cesium

#endif //_cesium_timer_hpp_
